package com.unittec.drainage.sdk.root.domain;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * @Description:
 * @author: chenjiawang
 * @CreateDate: 2020/2/3 18:29
 */
@Data
@EqualsAndHashCode(callSuper = false)
public class TreeNode implements Serializable {

    private static final long serialVersionUID = -6865343825640735212L;
    /**
     *
     */
    @ApiModelProperty(value = "主键")
    protected String id;
    /**
     *
     */
    @ApiModelProperty(value = "父ID")
    protected String parentId;

    /**
     *
     */
    @ApiModelProperty(value = "子节点集合")
    protected List<TreeNode> children = new ArrayList<>();

    public void add(TreeNode node) {
        children.add(node);
    }
}
